﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>后台管理系统</title>
    <meta name="author" content="DeathGhost"/>
    <link rel="stylesheet" type="text/css" href="Css/style.css">
    <!--[if lt IE 9]>
    <script src="Scripts/html5.js"></script>
    <![endif]-->
    <script src="Scripts/jquery.js"></script>
    <script src="Scripts/jquery.mcustomscrollbar.concat.min.js"></script>
    <script src="jquery.js"></script>
    <script>

        (function ($) {
            $(window).load(function () {

                $("a[rel='load-content']").click(function (e) {
                    e.preventDefault();
                    var url = $(this).attr("href");
                    $.get(url, function (data) {
                        $(".content .mCSB_container").append(data); //load new content inside .mCSB_container
                        //scroll-to appended content
                        $(".content").mCustomScrollbar("scrollTo", "h2:last");
                    });
                });

                $(".content").delegate("a[href='top']", "click", function (e) {
                    e.preventDefault();
                    $(".content").mCustomScrollbar("scrollTo", $(this).attr("href"));
                });

            });
        })(jQuery);
    </script>
</head>
<body>
<!--header-->
<header>
    <h1><img src="Picture/admin_logo.png"/></h1>
    <ul class="rt_nav">
        <li><a href="#" class="website_icon">站点首页</a></li>
        <li><a href="#" class="admin_icon">DeathGhost</a></li>
        <li><a href="#" class="clear_icon">清除缓存</a></li>
        <li><a href="#" class="set_icon">账号设置</a></li>
        <li><a href="login.jsp" class="quit_icon">安全退出</a></li>
    </ul>
</header>
<!--aside nav-->
<!--aside nav-->
<aside class="lt_aside_nav content mCustomScrollbar">
    <h2><a href="index.jsp">起始页</a></h2>
    <ul>
        <li>
            <dl>
                <dt>商品信息</dt>
                <!--当前链接则添加class:active-->
                <dd><a href="product_list.jsp">商品列表</a></dd>
                <dd><a href="recycle_bin.jsp">商品回收站</a></dd>
            </dl>
        </li>
        <li>
            <dl>
                <dt>订单信息</dt>
                <dd><a href="order_list.jsp">订单列表</a></dd>
            </dl>
        </li>

        <li>
            <dl>
                <dt>配送</dt>
                <dd><a href="express_list.jsp" class="active">配送方式</a></dd>
            </dl>
        </li>
        <li>
            <dl>
                <dt>在线统计</dt>
                <dd><a href="discharge_statistic.jsp" >流量统计</a></dd>
                <dd><a href="sales_volume.jsp">销售额统计</a></dd>
            </dl>
        </li>
        <li>
            <p class="btm_infor">© DeathGhost.cn 版权所有</p>
        </li>
    </ul>
</aside>

<section class="rt_wrap content mCustomScrollbar">
    <div class="rt_content">
        <div class="page_title">
            <h2 class="fl">配送方式</h2>
            <a href="express_detail.jsp" class="fr top_rt_btn add_icon">添加配送方式</a>
        </div>
        <c:if test="${page.list==null}">
            <c:redirect url="DistributionServlet?opr=list&pageNo=1"/>
        </c:if>
        <table class="table">
            <tr>
                <th>缩略图</th>
                <th>快递名称</th>
                <th>快递描述</th>
                <th>操作</th>
            </tr>
            <c:forEach items="${page.list}" var="distribution">
                <tr>
                    <td class="center"><img src="${distribution.dPath}" width="165" height="65"/></td>
                    <td>${distribution.dName}</td>
                    <td><p>${distribution.dDescribe}</p></td>
                    <td class="center">
                        <a href="DistributionServlet?opr=selectOne&id=${distribution.id}" title="编辑" class="link_icon">&#101;</a>
                        <a href="#" title="删除" class="link_icon" onclick="del('DistributionServlet?opr=delete&id=${distribution.id}')">&#100;</a>
                    </td>
                </tr>
            </c:forEach>
        </table>
        <aside class="paging">
            <a href="DistributionServlet?opr=list&pageNo=1">首页</a>
            <!--当页数小于2的时候不显示上一页按钮-->
            <c:if test="${page.pageNo>1}">
                <a href="DistributionServlet?opr=list&pageNo=${page.pageNo-1}">上一页</a>
            </c:if>
            <a href="#">${page.pageNo}</a>
            <!--当页数大于等于最后一页的时候不显示下一页按钮-->
            <c:if test="${page.pageNo<page.totalPage}">
                <a href="DistributionServlet?opr=list&pageNo=${page.pageNo+1}">下一页</a>
            </c:if>
            <a href="DistributionServlet?opr=list&pageNo=${page.totalPage}">最后一页</a>
        </aside>
    </div>
</section>

<section class="pop_bg">
    <div class="pop_cont">
        <!--title-->
        <h3>操作响应</h3>
        <!--content-->
        <!--以pop_cont_text分界-->
        <div class="pop_cont_text">
            确认要删除吗？
        </div>
        <!--bottom:operate->button-->
        <div class="btm_btn">
            <input type="button" value="确认" class="input_btn trueBtn" id="yz"/>
            <input type="button" value="关闭" class="input_btn falseBtn"/>
        </div>
    </div>
</section>

</body>
</html>
<script src="jquery.js"></script>
<script>
    function del(urid) {
        $(".pop_bg").fadeIn();
        $("#yz").click(function () {
            $.get(urid,function (data) {
                if(data=="true"){
                    location.reload();
                }
            })
        })
    }
    //弹出：确认按钮
    $(".trueBtn").click(function () {
        $(".pop_bg").fadeOut();
    });
    //弹出：取消或关闭按钮
    $(".falseBtn").click(function () {
        $(".pop_bg").fadeOut();
    });
</script>